Get new issues of The GitHub Insider in your inbox. Sign up now →
6 practical ways to give the tool context ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ ͏‌ 
GitHub

Does this ever happen to you? 👀

You’re in the zone, building something specific, but GitHub Copilot keeps tossing out code that’s… close, but not quite right. 😒

Here’s the fix: give Copilot the context it needs to understand your code. Think of it like onboarding a new team member. You wouldn’t expect them to know your standards and workflows on day one. But share that knowledge, and the new team member (i.e. Copilot) becomes far more effective and ready to roll up its sleeves.

In this edition of The GitHub Insider, we’ll show you six practical ways to make Copilot feel like part of your team. Let’s go!

1. Comments aren't just for devs anymore:

Look, I get it. Some devs say, "great code doesn't need comments." But here's the thing: Copilot reads your code like any developer would. So when you explain what my functions do (like describing that a function handles MCP data gathering for discovery rather than generic data processing), Copilot gets far better domain context.

💡 Pro tip: Write comments like you're explaining code to someone who’s just joining your project. Copilot will read them and stay aligned with your intent.

2. Set project-level instructions that actually work:

To ensure Copilot understands your project’s big picture, create a .github/copilot-instructions.md file at your repository’s root. This file is automatically included in every Copilot chat request, setting expectations for coding style, conventions, and priorities.

💡 Pro tip: VS Code can even help generate custom instructions automatically when you click the Configure Chat button.

3. Add task-specific guidance when needed:

Different parts of your codebase need different rules. Drop .instructions.md files in .github/instructions/ for specific workflows (e.g., react-components.instructions.md, api-routes.instructions.md). These tailor Copilot's behavior to particular tasks without cluttering project-wide instructions.

You can also use YAML frontmatter to auto-apply them. For example: applyTo: "**/tests/*.spec.ts" will automatically use the instructions when working on matching files.

💡 Pro tip: These work with Copilot's agent mode and can be referenced manually in chat queries like "Follow the guidelines in react-components.instructions.md.”

4. Create reusable prompts for your team:

Treat prompt files as conversation templates your team can share and reuse. Standardize prompts like: "Review this code following .github/prompts/code-review.prompt.md" to ensure consistent outputs. Share effective prompts in team docs and refine them based on Copilot's performance.

💡 Pro tip: Prompt files can reference your instruction files to combine general guidelines with task-specific directions. For example, a security review prompt can pull in your team's general security practices while adding specific reporting requirements for that particular review.

5. Use GitHub’s Model Context Protocol (MCP) server:

MCP lets Copilot connect to external tools and data sources during conversations. GitHub’s official MCP server gives Copilot access to repository data, issues, pull requests, and file contents in real time. When you enable this MCP server in VS Code, Copilot can search your GitHub repositories, reference specific files, and pull context from issues or discussions without you needing to manually provide that information.

💡 Pro tip: You can enable GitHub’s MCP server remotely in VS Code through the Copilot settings. It uses secure OAuth authentication so you don't need to manage API tokens. See this setup guide.

6. Keep the right files open:

This is a simple but effective tip, given that Copilot uses open files in your IDE to draw additional context. That means it’s in your interest to keep relevant code, tests, and instruction files open to improve suggestions. For example, when working on a React component, you might consider opening the component file, its tests, and .github/instructions/react-components.md.

💡 Pro tip: Use #editor in chat to reference the code currently visible in your active editor.

Try this today in five minutes 🕓

The real win? When your team's knowledge stops living only in people's heads and starts being accessible to everyone (including your AI tools), that's when the magic happens. Combine clear comments, focused instructions, and smart context to transform Copilot into a teammate who actually gets how your team works. Great code may speak for itself, but smart instructions ensure Copilot speaks your language.

Dive in deeper


✨ This newsletter was written by Andrea Liliana Griffiths and produced by Gwen Davis. ✨

More to explore 🌎



Join our GitHub Copilot conversations 🤖

Visit our community forum to see what people are saying + offer your own two cents.

Visit now



Stay updated on GitHub products 📦

Discover the latest ships, launches, and improvements in our Changelog.

Explore now



Subscribe to our LinkedIn newsletter 🚀

Do your best work on GitHub. Subscribe to our LinkedIn newsletter, Branching Out_.

Sign up now



GitHub Universe: Save big. Nerd out. Repeat. 🌈

Last chance: Snag $400 off your IRL pass and let the building begin.

Register now




GitHub

The world’s leading AI-powered developer platform.